package com.xsprite.managesys.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xsprite.managesys.bean.QueryRoleInfo;
import com.xsprite.managesys.bean.QueryServer;
import com.xsprite.managesys.service.ServersDatabaseManager;
import com.zhangzhang.struts.action.Action;

public class QueryPlayerBasicInfoAction extends Action{

	@Override
	protected void act(HttpServletRequest req, HttpServletResponse resp) {
		String playerName = req.getParameter("playerName");
		String serverId = req.getParameter("serverId");
		
		QueryServer server = ServersDatabaseManager.getInstance().getServerById(Integer.parseInt(serverId));
		QueryRoleInfo queryRoleInfo = ServersDatabaseManager.getInstance().queryRoleInfo(server.getGameDBId(), playerName);
		req.setAttribute("player", queryRoleInfo);
		super.act(req, resp);
	}
}
